// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 巡检记录情页 GET /api/patrolrecord/${param0} */
export async function getPatrolRecordInfo(
  params: {
    // path
    /** 任务id */
    id: number;
  },
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.PatrolRecord>(`/api/patrolrecord/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 获取巡检记录 GET /api/patrolrecord */
export async function queryPatrolRecord(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  },
  options?: { [key: string]: any },
) {
  return request<API.RequestData>('/api/patrolrecord', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}



/** 更新巡检记录 PUT /api/patrolrecord */
export async function updateOrSavePatrolRecordItem(body: API.PatrolRecord, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/patrolrecord/item/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 更新巡检记录 PUT /api/patrolrecord */
export async function updatePatrolRecord(body: API.PatrolRecord, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/patrolrecord', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 确认巡检记录 PUT /api/patrolrecord/conform */
export async function conformPatrolRecord(body: API.PatrolRecord, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/patrolrecord/conform', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}



/** 添加巡检记录 POST /api/patrolrecord */
export async function addPatrolRecord(body: API.PatrolRecord, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/patrolrecord', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}




/** 删除巡检记录 DELETE /api/patrolrecord */
export async function removePatrolRecord(
  params: {
    // query
    /** 对象主键 */
    id?: number;
  },
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/patrolrecord', {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 获取巡检记录 GET /api/patrolrecord/item */
export async function queryPatrolRecordItem(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
    /** 巡检id */
    id?: number;
    /** 任务id */
    jobId?: number;
  },
  options?: { [key: string]: any },
) {
  return request<API.RequestData>('/api/patrolrecord/item', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 更新巡检记录 PUT /api/patrolrecord/item */
export async function updatePatrolRecordItem(
  body: API.PatrolRecordItem[],
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/patrolrecord/item', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 添加巡检记录 POST /api/patrolrecord/item */
export async function addPatrolRecordItem(
  body: API.PatrolRecordItem,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/patrolrecord/item', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除巡检记录 DELETE /api/patrolrecord/item */
export async function removePatrolRecordItem(
  params: {
    // query
    /** 对象主键 */
    id?: number;
  },
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/patrolrecord/item', {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}



/** 获取巡检表 数据  GET /api/patrolrecord */
export async function queryPatrolRecordData(
  params: {
    // query
    /** 任务id */
    jobId: number;
  },
  options?: { [key: string]: any },
) {
  return request<API.RequestData>('/api/patrol/record', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}